<%--                                                                       --%>
<%-- Copyright (c) 2001-2003 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries.     --%>


<%@ page language="java" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> 

<script language="JavaScript">
<!--

function confirmDeleteDiscussionGroup()
{
   if (confirm('<bean:message key="cs.confirm.delete.discussion"/>'))
   {
      return true;
   }
   else
   {
      return false;
   }
}

// -->
</script>


<!-- Zone 5 starts here.  -->
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0"       summary="<bean:message key="cs.content.area"/>">
  <tr>
    <td valign="top">
    
    <div class="pageTitle">
      <%@ include file="/cs/microsite/micrositeNaviInfo.jsp" %>
    </div> 

<!--start title bar here-->
    <div class="pageSubtitle">
      <span class="left">
        <bean:message key="cs.discussions.index"/>
      </span>
      <span class="right">
       <logic:equal name="isMSOwner" scope="request" value="true">
        <input type="button" onclick="location='<html:rewrite page="/cs/discussionEdit.do" name="micrositeNaviInfoView" property="urlParams" scope="request"/>'" class="titleButton" value="<bean:message key="cs.create.new.discussion"/>"/>
       </logic:equal>
      </span>
    </div> 

   <div class="blockWrap">

<!--start main content area here-->
  
<table class="dataTable" border="0" cellspacing="1" cellpadding="2" 
       summary="Participant list table" width="100%">

  <tr class="listHeader"> 
    <th id="discussionName" align="left"><bean:message key="cs.name"/></th>
    
    <th id="actions" align="left">
    <!--If user is not owner, do not show "action" word-->
    <logic:equal name="isMSOwner" scope="request" value="true">
    <bean:message key="cs.actions"/>    
    </logic:equal>
    <logic:equal name="isMSOwner" scope="request" value="false"> 
    &nbsp;
    </logic:equal>
    </th> 
  </tr>

  <!--start discussion groups iteration here-->
  <!-- discussion groups display for owner user -->
  <logic:equal name="isMSOwner" scope="request" value="true">
  <logic:iterate id="dGroup" name="discussionGroupList" indexId="index"> 
     <tr class=<%= index.intValue() % 2 == 0 ? "\"listEven\"" : "\"listOdd\""%>>
      <td headers="discussionName" width="60%"><html:link page="/cs/discussionView.do" name="dGroup" property="urlParams"><bean:write name="dGroup" property="name"/></html:link></td>
      <td headers="discussionName" width="40%" nowrap align="left">
      <logic:equal name="dGroup" property="status" value="1"> 
        <html:link page="/cs/discussionStatusChange.do?status=0" name="dGroup" property="urlParams"><html:img page="/cs/images/action/icon_deactivate.gif" styleClass="actionIcon" altKey="cs.action.deactivate" border="0"/></html:link>
      </logic:equal>
      <logic:equal name="dGroup" property="status" value="0">
        <html:link page="/cs/discussionStatusChange.do?status=1" name="dGroup" property="urlParams"><html:img page="/cs/images/action/icon_activate.gif" styleClass="actionIcon" altKey="cs.action.activate" border="0"/></html:link>
      </logic:equal>
      <html:link page="/cs/discussionEdit.do" name="dGroup" property="urlParams"><html:img page="/cs/images/action/icon_edit.gif" styleClass="actionIcon" altKey="button.edit" border="0"/></html:link>
      <html:link page="/cs/discussionDelete.do" name="dGroup" property="urlParams" onclick="return confirmDeleteDiscussionGroup()"><html:img  page="/cs/images/action/icon_delete.gif" styleClass="actionIcon" altKey="button.delete" border="0"/></html:link>
      </td> 

    </tr>
  </logic:iterate> 
      <logic:equal name="discussionGroupList" property="empty" value="true">
        <tr class="listOdd">
          <td align="center" colspan="5">
            <bean:message key="cs.collaboration.noDiscussions"/>
          </td>
        </tr>
      </logic:equal>      
  </logic:equal>

  <!-- discussion groups display for no owner user-->
  <logic:notEqual name="isMSOwner" scope="request" value="true">
  <logic:iterate id="dGroup" name="discussionGroupList" indexId="index"> 
 
   <logic:equal name="dGroup" property="status" value="1">
     <tr class=<%=index.intValue() %2 == 0 ? "\"listEven\"" : "\"listOdd\""%>>
       <td headers="discussionName" width="60%" class="listItem"><html:link page="/cs/discussionView.do" name="dGroup" property="urlParams"><bean:write name="dGroup" property="name" /></html:link></td>
       <td headers="actions" width="40%" >&nbsp;</td>
     </tr>
  </logic:equal>
  </logic:iterate> 
  </logic:notEqual> 

  <!--end discussion groups alteration here-->
</table>

</div> <!-- end of blockWrap -->

<!--end main content area here-->
</td>
</tr>
</table>	
